<?php

class Category extends AppModel {
	public $hasMany = array(
		'Page' => array(
			'className' => 'Page',
			'foreignKey' => 'id_cat',
			'order' => 'Page.id DESC'
		),
		'Children'=>array(
		  'className'=>'Category',
		  'foreignKey'=>'id_parent'
		)		
	);
	
	var $belongsTo = array(
		'Parent' => array(
		  'className'=>'Category',
		  'foreignKey'=>'id_parent'
		)
	  );
	
	public $validate = 
		array(
			'name' => array(
			'rule' => 'notEmpty'
		)
	);

}

?>